<template>
  <div class="multiple-select question-content">
    <Editable v-model="data.title" />
    <el-checkbox-group v-model="data.value" class="radio-group">
      <div v-for="item in options" :key="item.value" class="option">
        <el-checkbox label="" :value="item.label" />
        <Editable class="label" v-model="item.label" @click="onClick(item)" />
      </div>
    </el-checkbox-group>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
const props = defineProps<{
  data: any
}>()
const options = props.data.data
const value = ref([])

const onClick = (item: any) => {
  if (value.value.includes(item.value)) {
    value.value = value.value.filter((v: any) => v !== item.value)
  } else {
    value.value.push(item.value)
  }
}
</script>

<style lang="scss" scoped>
@import url(./questionCommon.scss);
</style>
